<html><head><title>KeyboardInkey</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">KeyboardInkey()</font></b></p>
<p><b>Syntax</b></p><blockquote>
String$ = <font color="#3A3966"><b>KeyboardInkey</b></font>()</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Returns the last typed character, very useful when keyboard input is required within a 
gaming application, such as the name in highscore, in game console, etc.). 

</blockquote><p><b>Parameters</b></p><blockquote>
None.


</blockquote><p><b>Return value</b></p><blockquote>

The last typed character. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">InitSprite</font>() <b><font color="#3A3966">And</font></b> <font color="#3A3966">InitKeyboard</font>() <b><font color="#3A3966">And</font></b> <font color="#3A3966">OpenScreen</font>(800, 600, 32, &quot;&quot;)
    <b><font color="#3A3966">Repeat</font></b>
<font color="#3A3966">      FlipBuffers</font>()
<font color="#3A3966">      ClearScreen</font>(<font color="#3A3966">RGB</font>(0, 0, 0))
     
<font color="#3A3966">      ExamineKeyboard</font>()
     
      <font color="#3A3966">; If we press the 'Back' key, we will delete the last character</font>
      <font color="#3A3966">;</font>
      <b><font color="#3A3966">If</font></b> <font color="#3A3966">KeyboardReleased</font>(<font color="#924B72">#PB_Key_Back</font>)
        FullText$ =<font color="#3A3966"> Left</font>(FullText$,<font color="#3A3966"> Len</font>(FullText$)-1)
      <b><font color="#3A3966">Else</font></b>
        result$=<font color="#3A3966">KeyboardInkey</font>()
        <b><font color="#3A3966">If</font></b> <font color="#3A3966">FindString</font>(&quot;1234567890 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;, result$) <font color="#3A3966">; Or your chosen valid characters</font>
          FullText$ + result$
        <b><font color="#3A3966">EndIf</font></b> <font color="#3A3966">; Add the new text to the current one (if any)</font>
      <b><font color="#3A3966">EndIf</font></b>
     
      <font color="#3A3966">; Display the result</font>
      <font color="#3A3966">;</font>
      <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartDrawing</font>(<font color="#3A3966">ScreenOutput</font>())
<font color="#3A3966">          DrawingMode</font>(1)
<font color="#3A3966">          FrontColor</font>(<font color="#3A3966">RGB</font>(128, 255, 0))
<font color="#3A3966">          DrawText</font>(20, 20, &quot;Just type some text...:&quot;)
<font color="#3A3966">          DrawText</font>(20, 40, FullText$)
<font color="#3A3966">        StopDrawing</font>()
      <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Until</font></b> <font color="#3A3966">KeyboardPushed</font>(<font color="#924B72">#PB_Key_Escape</font>)
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="examinekeyboard.html">ExamineKeyboard()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=initkeyboard.html>InitKeyboard()</a> - <a href="index.html">Keyboard Index</a> - <a href="keyboardmode.html">KeyboardMode()</a> -><br><br>

</body></html>